﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClearingGraphAutomaton.Base
{
    partial class Graph
	{
        /// <summary>
        /// Class representing the node of the 2D graph.
        /// </summary>
        public class Node
        {
            /// <summary>
            /// Creates the instance of the node.
            /// </summary>
            /// <param name="row">Row of the node.</param>
            /// <param name="col">Column of the node.</param>
            public Node(int row, int col)
            {
                this.Row = row;
                this.Col = col;
                this.Edges = new List<Edge>();
            }

            /// <summary>
            /// Row of the node.
            /// </summary>
            public int Row { get; protected set; }

            /// <summary>
            /// Column of the node.
            /// </summary>
            public int Col { get; protected set; }

            /// <summary>
            /// The list of edges of the node.
            /// </summary>
            public List<Edge> Edges { get; protected set; }

            /// <summary>
            /// Color of the node.
            /// </summary>
            public int Color { get; set; }

            /// <summary>
            /// Returns the string representation of the color of this node.
            /// </summary>
            /// <returns>String representation of the color of this node.</returns>
            public override string ToString()
            {
                if (this.Color == -1)
                {
                    return "$";
                }
                else
                {
                    return this.Color.ToString();
                }
            }
        }
    }
}
